/*
 * Copyright (C) 2018 guomw.Inc. All rights reserved.
 * 项目名称： report-manage
 * 文件名称： UserGeneTesting.java
 * Date：18-11-6 下午2:32
 * Author: guomw
 */

package com.guomw.report.service.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.guomw.report.common.config.Constant;
import lombok.Data;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * @author guomw
 * @date 2018/11/6
 */
@Data
@Entity
@Table(name = "Mall_UserGeneTesting")
public class UserGeneTesting {

    /**
     * 条码
     */
    @Id
    @Column(name = "BarCode", length = 50)
    private String barCode;

    /**
     * 订单ID
     */
    @Column(name = "OrderId", length = 50)
    private String orderId;

    /**
     * 用户ID
     */
    @Column(name = "UserId")
    private Integer userId;

    /**
     * 商户ID
     */
    @Column(name = "customerId")
    private Integer customerId;

    /**
     * 姓名
     */
    @Column(name = "Name", length = 50)
    private String userName;

    /**
     * 性别
     */
    @Column(name = "Gender", length = 10)
    private String userGender;

    /**
     * 年龄
     */
    @Column(name = "Age")
    private Integer userAge;

    /**
     * 区域
     */
    @Column(name = "Area", length = 50)
    private String userArea;

    /**
     * 地址
     */
    @Column(name = "Address", length = 50)
    private String userAddress;

    /**
     * 体重
     */
    @Column(name = "Weight", length = 50)
    private String userWeight;

    /**
     * 身高
     */
    @Column(name = "Stature", length = 50)
    private String userStature;
    /**
     * 检测项目
     */
    @Column(name = "ProjectName", length = 50)
    private String projectName;
    /**
     * 条码状态 0,默认 1已绑定条码；2已送检，3检测中，4报告已上传
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 使用状态
     */
    @Column(name = "UseStatus")
    private Integer useStatus;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = Constant.DATETIME_FORMAT)
    @Column(name = "CreateTime", columnDefinition = "datetime")
    private LocalDateTime createTime;

    /**
     * 报告token
     * 格式 report_ + 32位 条码barCode hash值
     */
    @Column(name = "ReportToken", length = 100)
    private String reportToken;

    /**
     * 手机号
     */
    @Column(name = "Mobile", length = 20)
    private String mobile;

    /**
     * 关键字
     */
    @Column(name = "Keywords", length = 250)
    private String keywords;

    /**
     * 报告地址
     */
//    @Column(name = "ReportUrl", length = 200)
//    private String reportUrl;
    /**
     * 已上链
     */
    @Column(name = "Chained")
    private int chained = 0;

    @Column(name = "GCode", length = 100)
    private String GCode;

    @Column(name = "MCode", length = 100)
    private String MCode;

    /**
     * 所含报告 json 数据
     */
    @Lob
    @Column(name = "reports")
    private String reports;

    /**
     * 上链的数据
     */
    @Lob
    @Column(name = "chain")
    private String chain;



}
